<?php
  $key = $_GET['key'];
  switch($key){
    case "results":
      require_once("results.inc.php");
      break;
    case "kontakt":
      require_once("kontakt.inc.php");
      break;
    case "projekt":
      require_once("projekt.inc.php");
      break;
    default:
      require_once("404.inc.php");
      break;
  }
  /*
  jetzt definierte variablen:
    $title -> html-<title>-tag
    $header -> evtl. zusätzliche tags in <header>
    $content -> alles nach #top
  */
?>
<?php
	$relativeToRoot = $_SERVER['REQUEST_URI'];
	$domain = "http://".$_SERVER['HTTP_HOST'].$relativeToRoot;
	$iLastOccurenceOfSlash = strripos($domain,'/') + 1;
	$root = substr($domain,0,$iLastOccurenceOfSlash);
?>
<!DOCTYPE html> 
<html>
<head>
  <title><?php echo $title; ?></title>
  <script type="text/javascript" src="jquery.js"></script>
  <?php echo $header; ?>
  <meta content="Beni Bichsel" name="author">
  <link type="text/css" href="style.css" rel="stylesheet">
  <meta charset="utf-8">
  <link rel="shortcut icon" href="favicon.ico" />
  <script type="text/javascript" src="referrer.js"></script>
</head>
<body>
  <div id="zentriert">
    <div id="top">
      <img title="GerTradix" src="pictures/gertradix-logo_search.png" /> 
      <div id="topright">
        <div id="links">
          <a href="<?php echo($root); ?>">Home</a> | <a href="index.php?key=kontakt">Kontakt</a> | <a href="index.php?key=projekt">Das Projekt</a>
        </div>
        <div id="suchfeld">
          <form id="action" action="index.php">
            <input type="hidden" name="key" value="results" /><input id="suchfeldText" type="text" name="text" value=""/><input type="submit" id="submit" value="" />
          </form>
        </div>
      </div>
    </div>
  	<div id="main">
      <?php echo $content; ?>
    </div>
    <div id="footer">
      <div id="footerlinks"><a href="<?php echo($root); ?>">Home</a> | <a href="index.php?key=kontakt">Kontakt</a> | <a href="index.php?key=projekt">Das Projekt</a> | <iframe id="facebookLikeBox" src="http://www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2F%23%21%2Fpages%2FGerTradix%2F103915683026860&amp;layout=button_count&amp;show_faces=false&amp;width=120&amp;action=like&amp;font&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:120px; height:21px;" allowTransparency="true"></iframe></div>
      <div id="copyright">&copy; 2010-2011 GerTradix - Beni Bichsel | Webdesign by <a href="http://www.jonathanheitz.ch">Jonathan Heitz</a></div>
    </div>
  </div>
<script type="text/javascript" src="google-analytics.js"></script>
</body>
</html>